-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: better use of autograd for base lens quantities #306
Conversation
This may also address #242 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #306 +/- ##
==========================================
+ Coverage 91.19% 91.91% +0.72%
==========================================
Files 55 55
Lines 2306 2277 -29
==========================================
- Hits 2103 2093 -10
+ Misses 203 184 -19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NFW and tNFW not passing the test for potential. Any idea why that is?
Ah, that was because I made the new thin lens default reduced deflection angle compute the gradient of the potential (rather than cyclic definition with physical deflection angle). The way that calculation is done involves a vmap, and NFW/TNFW cant do both vmap and autograd. Nothing changed about NFW/TNFW, they still work, just the test now uses vmap and autograd rather than a very large autograd call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great improvement! I presume the #fixme
comment in _P_tnfw
is fixed now?
Now one need only define a lens potential and the deflection angles will be computed from it's gradient, and the convergence will be computed from the hessian. Also, implemented better version of the jacobian of the deflection angles.